package org.tio.im.server.http.api;

import org.tio.core.ChannelContext;
import org.tio.im.common.ImPacket;
import org.tio.im.common.http.HttpConfig;
import org.tio.im.common.http.HttpRequest;
import org.tio.im.common.http.HttpResponse;
import org.tio.im.server.command.handler.ChatReqHandler;
import org.tio.im.server.command.handler.OrderNotifyReqHandler;
import org.tio.im.server.http.annotation.RequestPath;

@RequestPath("order")
public class OrderController {

    @RequestPath(value = "/notify")
    public HttpResponse notify(HttpRequest request, HttpConfig httpConfig, ChannelContext channelContext) throws Exception {
        HttpResponse response = new HttpResponse(request, httpConfig);
        ImPacket chatPacket = new OrderNotifyReqHandler().handler(request, channelContext);
        if (chatPacket != null) {
            response = (HttpResponse) chatPacket;
        }
        return response;
    }
}
